<?php
$host = $_SERVER["HTTP_HOST"] ?? $_SERVER["SERVER_NAME"];
//环境区分
if (preg_match('/my|dev|test|pre/', strtolower($host), $matches) || true) {
    define('ENV', true);
    define('APP_DEBUG', true);
    define('DB_DEBUG', true);
    define('APP_TRACE', true);
} else {
    define('DB_DEBUG', false);
    define('APP_DEBUG', false);
    define('APP_TRACE', false);
}

// 定义应用目录
define('APP_PATH', __DIR__ . '/../application/');
define('ROOT_PATH', dirname(__DIR__) );
// 加载框架引导文件
define("HOME_HOST", "http://" . $host);
if (preg_match('/admin/', strtolower($host))){
    define('BIND_MODULE', 'admin');
}else{
    define('BIND_MODULE', 'index');
}
require __DIR__ . '/../thinkphp/start.php';

// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

// [ 应用入口文件 ]


